var ArriveManager = function(){
	this.interact = function(tpf,entities){
		for(var i=0;i<entities.length;i++){
		arriveComponent = entities[i].arriveComponent;
		vehicleComponent = entities[i].vehicleComponent;
		spatialComponent = entities[i].spatialComponent;

		target_offset = arriveComponent.target.spatialComponent.position.subtract(spatialComponent.position);
		distance = target_offset.length();
		
		ramped_speed = vehicleComponent.max_speed*(distance / arriveComponent.slowing_distance);
		clipped_speed = Math.min(ramped_speed,vehicleComponent.max_speed);

		desired_velocity = target_offset.x(clipped_speed / distance);
		vehicleComponent.steering_direction = desired_velocity.subtract(vehicleComponent.velocity).x(arriveComponent.weight);
		
		arriveComponent.steering_direction = vehicleComponent.steering_direction;
		}
	}
}